#ifndef __CZF__XML_STRUCT_H__
#define __CZF__XML_STRUCT_H__

#include "typedefs.h"
#include "errordef.h"

#define XML_CONTENT_ELEMENT_TYPE 1
#define XML_CONTENT_CDATA_TYPE   2
#define XML_CONTENT_PI_TYPE      3

typedef struct _tagXmlAttribute
{
   char* pName;
   char* pValue;
} XmlAttribute, *LPXmlAttribute;

typedef struct _tagXmlElement
{
   char* pName;
   XmlAttribute** ppAttributes;
   int nCount;
} XmlElement, *LPXmlElement;

typedef struct _tagXmlCDATA
{
   char* pCDATA;
} XmlCDATA, *LPXmlCDATA;

typedef struct _tagXmlPI
{
   char* pAppName;
   char* pInstruction;
} XmlPI, *LPXmlPI;


struct _tagXmlContent;

typedef struct _tagXmlContent
{
   int nType;
   int nLine;
   int nColumn;
   _tagXmlContent* pParent;
   union 
   {
      XmlElement element;
      XmlCDATA   cdata;
      XmlPI      pi;
   };
} XmlContent, *LPXmlContent;

#endif // __CZF__XML_STRUCT_H__
